\rcube_spellchecker

Helper class for spellchecking with GoogieSpell and PSpell support.

Summary

Methods
Properties
Constants
__construct()
languages()
check()
found()
get_suggestions()
get_words()
get_xml()
get()
error()
is_exception()
add_word()
remove_word()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
html2text()
update_dict()
load_dict()
$matches
$options
$content
$engine
$backend
$lang
$rc
$error
$dict
$have_dict
N/A

Properties

$matches

$matches

$options

$options

$content

$content

$engine

$engine

$backend

$backend

$lang

$lang

$rc

$rc

$error

$error

$dict

$dict

$have_dict

$have_dict

Methods

__construct()

__construct(string  $lang = 'en') : mixed

Constructor

Parameters

string $lang

Language code

Returns

mixed —

languages()

languages() : mixed

Return a list of supported languages

Returns

mixed —

check()

check(string  $text, bool  $is_html = false) : bool

Set content and check spelling

Parameters

string $text

Text content for spellchecking

bool $is_html

Enables HTML-to-Text conversion

Returns

bool —

True when no misspelling found, otherwise false

found()

found() : int

Number of misspellings found (after check)

Returns

int —

Number of misspellings

get_suggestions()

get_suggestions(string  $word) : array

Returns suggestions for the specified word

Parameters

string $word

The word

Returns

array —

Suggestions list

get_words()

get_words(string  $text = null, mixed  $is_html = false) : array

Returns misspelled words

Parameters

string $text

The content for spellchecking. If empty content used for check() method will be used.

mixed $is_html

Returns

array —

List of misspelled words

get_xml()

get_xml() : string

Returns checking result in XML (Googiespell) format

Returns

string —

XML content

get()

get() : array

Returns checking result (misspelled words with suggestions)

Returns

array —

Spellchecking result. An array indexed by word.

error()

error() : string

Returns error message

Returns

string —

Error message

is_exception()

is_exception(string  $word) : bool

Check if the specified word is an exception according to the spellcheck options.

Parameters

string $word

The word

Returns

bool —

True if the word is an exception, False otherwise

add_word()

add_word(string  $word) : mixed

Add a word to dictionary

Parameters

string $word

The word to add

Returns

mixed —

remove_word()

remove_word(string  $word) : mixed

Remove a word from dictionary

Parameters

string $word

The word to remove

Returns

mixed —

html2text()

html2text(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

update_dict()

update_dict() : mixed

Update dictionary row in DB

Returns

mixed —

load_dict()

load_dict() : mixed

Get dictionary from DB

Returns

mixed —